package com.lisp.algorithm.sort;

import com.lisp.algorithm.util.SortUtil;

public class BubbleSort {

    public static void main(String[] args) {
        SortUtil.test(BubbleSort::sort);
    }
    
    public static void sort(int a[]) {
        for(int round=1; round<a.length; round++) {
            for(int j=0; j<a.length-round; j++) {
                if(a[j] > a[j+1]) {
                    int tmp = a[j];
                    a[j] = a[j+1];
                    a[j+1] = tmp;
                }
            }
        }
    }
}
